"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const geoserver_js_1 = require("./util/geoserver.js");
class ResetReloadClient {
    constructor(url, auth) {
        this.url = url;
        this.auth = auth;
    }
    async reset() {
        const url = this.url + 'reset';
        const response = await fetch(url, {
            credentials: 'include',
            method: 'POST',
            headers: {
                Authorization: this.auth
            }
        });
        if (!response.ok) {
            const geoServerResponse = await (0, geoserver_js_1.getGeoServerResponseText)(response);
            throw new geoserver_js_1.GeoServerResponseError(null, geoServerResponse);
        }
    }
    async reload() {
        const url = this.url + 'reload';
        const response = await fetch(url, {
            credentials: 'include',
            method: 'POST',
            headers: {
                Authorization: this.auth
            }
        });
        if (!response.ok) {
            const geoServerResponse = await (0, geoserver_js_1.getGeoServerResponseText)(response);
            throw new geoserver_js_1.GeoServerResponseError(null, geoServerResponse);
        }
    }
}
exports.default = ResetReloadClient;
